package com.lwq.commentTool.model;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class CookBlockModel {
	private Map<String,CookItemModel> Block = null;
	public CookBlockModel() {
		if(Block == null){
			Block = new HashMap<String,CookItemModel>();
		}
	}
	public Map<String,CookItemModel> getBlock() {
		return Block;
	}
	public void setBlock(Map<String,CookItemModel> block) {
		Block = block;
	}
	
	public String getRandomText(String type) {
		String randomText = null;
		if(Block != null){
			Iterator iterator  = Block.keySet().iterator();
			CookItemModel item = null;
			while(iterator.hasNext()){
				item = Block.get(iterator.next());
				if(randomText == null){
					randomText = item.getRandomText(type);
				}else{
					randomText += item.getRandomText(type);
				}
			}
		}
		return randomText;
	}

}
